package com.chengjj.kings.core.mutidatasource;

/**
 * @Author: 成俊杰
 * @CreateDate: 2019/3/12
 * @Version: 1.0
 * @Description:
 */
public class DataSourceContextHolder {
    private static final ThreadLocal<String> contextHolder = new ThreadLocal<>();

    public DataSourceContextHolder() {
    }

    public static void setDataSourceType(String dataSourceType) {
        contextHolder.set(dataSourceType);
    }

    public static String getDateSourceType() {
        return (String) contextHolder.get();
    }

    public static void clearDataSourceType() {
        contextHolder.remove();
    }
}
